{extend name="public:base" /}
{block name="style"}
    <style>

    </style>
{/block}
{block name="script"}
    <script>
        layui.use('form', function () {
            var form = layui.form, layer = layui.layer, $ = layui.jquery;
            form.on('submit(submit)', function (data) {
                layer.load({ time: 0 });
                $.post(data.form.action, data.field, function (e) {
                    layer.closeAll('loading');
                    if (e.code == 1) {
                        layer.msg(e.msg, { icon: 1, shade: 0.5, });
                        setTimeout(function () { window.location.href = e.url; }, 1000);
                    } else {
                        layer.msg(e.msg, { icon: 2, shade: 0.5, time: 2000, shadeClose: true });
                    }
                })
                return false;
            });
        });
    </script>
{/block}
{block name="body"}
    <fieldset class="layui-elem-field layui-field-title">
        <legend>修改导航</legend>
    </fieldset>


    <form class="layui-form " action="">
        <div class="layui-form-item">
            <label class="layui-form-label">导航名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" value="{$F.name}" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
                <label class="layui-form-label">导航排序</label>
                <div class="layui-input-inline">
                    <input type="text" name="sort" value="{$F.sort}" placeholder="数小靠前 不填为99" autocomplete="off" class="layui-input">
                </div>
            </div>
        <div class="layui-form-item">
            <label class="layui-form-label">导航分类</label>
            <div class="layui-input-inline">
                <select name="pid" lay-verify="required">{$F.pid}
                  <option value="0" {eq name="F.pid" value="0"}selected{/eq}>顶级分类</option>
                  {volist name="list" id="vo"}
                    <option value="{$vo.id}" {eq name="F.pid" value="$vo.id"}selected{/eq} >{$vo.name}</option>
                  {/volist}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否新窗</label>
            <div class="layui-input-block">
                <input type="checkbox" name="target" {eq name="F.target" value="_blank"}checked{/eq}  value="_blank" lay-text="开启|关闭" lay-skin="switch">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否连接</label>
            <div class="layui-input-block">
                <input type="checkbox" name="url_state" {eq name="F.url_state" value="1"}checked{/eq}  value="1" lay-text="开启|关闭" lay-skin="switch">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">连接地址</label>
            <div class="layui-input-block">
                <input type="text" name="url" value="{$F.url}"  placeholder="外部连接请填写http// 本站连接请填写模块名/控制器/方法名" autocomplete="off"
                    class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否显示</label>
            <div class="layui-input-block">
                <input type="checkbox" value="1"  {eq name="F.state" value="1"}checked{/eq}  name="state" lay-text="开启|关闭"  lay-skin="switch">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="submit">立即提交</button>
                
            </div>
        </div>
    </form>

{/block}